package info.davidesposito.bamboomonitor.loops;

import info.davidesposito.bamboomonitor.loops.BambooLoopModule.BuildStatus;
import info.davidesposito.bamboomonitor.loops.BambooLoopModule.LoopStatus;

public class BambooLoop {

	private BuildStatus buildStatus;
	private LoopStatus loopStatus;
	private final String name;
	private final String id;
	
	public BuildStatus getBuildStatus() {
		return buildStatus;
	}

	public void setBuildStatus(BuildStatus buildStatus) {
		this.buildStatus = buildStatus;
	}

	public LoopStatus getLoopStatus() {
		return loopStatus;
	}

	public void setLoopStatus(LoopStatus loopStatus) {
		this.loopStatus = loopStatus;
	}

	public String getName() {
		return name;
	}

	public String getId() {
		return id;
	}

	public BambooLoop(String name, String id) {
		this.name = name;
		this.id = id;
		this.buildStatus = BuildStatus.WAITING;
		this.loopStatus = LoopStatus.PASSING;
	}
	
	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder("{");
		sb.append(this.name).append(":").append(loopStatus.name()).append(",");
		return sb.append(buildStatus.name()).append("}").toString();
	}
}
